const joi = require('joi');

const year = joi.number().required();
const month = joi.number().required();

const department_id = joi.number().required();
const user_id = joi.number().required();

const start_date = joi.date().required();
const end_date = joi.date().required();
const reason = joi.string();
const approver_id = joi.number().required();
const proposer_id = joi.number().required();
const proposer_date = joi.date().required();

const rl_id = joi.number().required();

const overtime_date = joi.date().required();
const overtime_hour = joi.number().required();

const ol_id = joi.number().required();

const init_day = joi.number();
const rest_day = joi.number();

const holiday_name = joi.string().required();
const holiday_start_date = joi.date().required();
const holiday_end_date = joi.date().required();
const holiday_rest_day = joi.number().required();


// 查询公司考勤
exports.getCompanyAttendance_schema = {
	body: {
		year,
		month
	}
}

// 查询部门考勤
exports.getDepartmentAttendance_schema = {
	body: {
		year,
		month,
		department_id
	}
}

// 查询个人考勤
exports.getUserAttendance_schema = {
	body: {
		year,
		month,
		user_id
	}
}

// 查询考勤记录
exports.getUserAttendanceStat_schema = {
	body: {
		year,
		month,
		user_id
	}
}

// 申请调休
exports.applyRest_schema = {
	body: {
		start_date,
		end_date,
		reason,
		approver_id,
		proposer_id,
		proposer_date
	}
}

// 查询自己的调休记录
exports.getRestLog_schema = {
	body: {
		user_id
	}
}

// 查询需要自己审核的调休记录
exports.getAuditRsetLog_schema = {
	body: {
		user_id
	}
}

//拒绝调休申请
exports.refuseRest_schema = {
	body: {
		rl_id
	}
}

// 同意调休申请
exports.agreeRest_schema = {
	body: {
		rl_id,
	}
}

// 申请加班
exports.applyOvertime_schema = {
	body: {
		overtime_date,
		overtime_hour,
		reason,
		approver_id,
		proposer_id,
		proposer_date
	}
}

// 查询自己的加班申请
exports.getOvertimeLog_schema = {
	body: {
		user_id
	}
}

// 查询由自己审核的加班申请
exports.getAuditOvertimeLog_schema = {
	body: {
		user_id
	}
}

//拒绝加班申请
exports.refuseOvertime_schema = {
	body: {
		ol_id
	}
}

// 同意加班申请
exports.agreeOvertime_schema = {
	body: {
		ol_id
	}
}

// 更新初始化
exports.updateInitial_schema = {
	body: {
		init_day,
		rest_day
	}
}

// 节假日设置
exports.holidaysRest_schema = {
	body: {
		holiday_name,
		holiday_start_date,
		holiday_end_date,
		holiday_rest_day
	}
}